#include<stdio.h>
#define _CRT_SECURE_NO_WARNINGS

int search(int* nums, int numsLen, int target)
{
    if (numsLen == 0)return -1;
    int left = 0, right = numsLen - 1, mid;
    while (left <= right)
    {
        mid = (left + right) / 2;
        if (target > nums[mid]) left = mid + 1;
        else if (target < nums[mid]) right = mid - 1;
        else return mid;
    }
    return -1;


}
int main()
{
    int nums[] = {1,2,3,4,5,6,7,8};
    int numsLen = sizeof(nums) / sizeof(nums[0]);
    int target = 0;
    scanf("%d", &target);
    search(nums, numsLen, target);
    return 0;
}